/**
 * @file Circle.cpp
 * 
 * This file contains the definitions of all the funcitons to manipulate the 
 * Circle class.
 */
#include "Shape.hpp"
#include "Circle.hpp"

/**
 * Default constructor
 */
Circle::Circle(){}

/**
 * Circle constructor
 * @param name: x, y, size, and color - description: center point, size and color
 * given by the user.
 */
Circle::Circle( int x, int y, int size, COLORREF color ) : Shape( x, y, size, color )
{}

/**
 * Destructor
 */
Circle::~Circle(){}

/**
 * Returns true if coordinance of a point is inside the Circle
 * @param name: x, y - description: coordinance given by the user.
 */
bool Circle::contains( int x, int y )
{ 
	x = x - center.x;
	y = y - center.y;
	
	if( x*x + y*y < ( radius * radius ) )
		return true;
	else
		return false;
}

/**
 * Draws a circle inside the shape boundaries.
 * @param name: canvas - description: object passed by reference to 
 * specify how a circle should be drawn.
 */
void Circle::draw( Canvas& canvas )
{
	center.x = x;
	center.y = y;
	radius = size / 2;

	canvas.drawEllipse( center, radius, RGB( 0,0,0 ), color );
}